package com.lvmama.client.rhino;

import com.github.pagehelper.PageInfo;
import com.lvmama.common.result.Result;
import com.lvmama.pojo.dto.rhino.topic.StatisticCodesConditionVO;
import com.lvmama.pojo.entity.rhino.topic.StatisticCode;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Map;

/**
 * @param
 * @Title:
 * @Author:wangpeng
 * @Description: TODO(这里用一句话描述这个方法的作用)
 * @return
 * @throws
 */
@FeignClient("rhino-web-service")
@RequestMapping("${server.servlet.context-path}")
public interface StatisticCodeClient {

	@RequestMapping(method = RequestMethod.POST,value = "/code/getAllList", consumes = "application/json")
	PageInfo<StatisticCode> getAllList(@RequestBody StatisticCodesConditionVO sc);

	@RequestMapping(method = RequestMethod.GET, value = "/code/treeviewStr", consumes = "application/json")
	Result<String> treeviewStr();

	@RequestMapping(method = RequestMethod.GET, value = "/code/edit", consumes = "application/json")
	Result<Map<String, Object>> edit(@RequestParam(value = "codeId") String codeId);

	@RequestMapping(method = RequestMethod.POST, value = "/code/save", consumes = "application/json")
	Result<Map<String, Object>> saveCode(@RequestBody StatisticCode statisticCode, @RequestParam(value = "parentId") Integer parentId, @RequestParam(value = "isNew") boolean isNew);

	@RequestMapping(method = RequestMethod.GET, value = "/code/treegrid", consumes = "application/json")
	Result<String> treegrid( @RequestParam(value = "parentName") String parentName);

	@RequestMapping(method = RequestMethod.GET, value = "/code/saveCodeTree", consumes = "application/json")
	Result<Map<String, Object>> saveCodeTree( @RequestParam(value = "codeInfo") String codeInfo);

	@RequestMapping(method = RequestMethod.GET, value = "/code/createCode", consumes = "application/json")
	Result<Map<String, Object>> createCode( @RequestParam(value = "parentCode") String parentCode);

	@RequestMapping(method = RequestMethod.GET, value = "/code/createPitCode", consumes = "application/json")
	Result<Map<String, Object>> createPitCode( @RequestParam(value = "page") String page,@RequestParam(value = "pitName") String pitName);

	@RequestMapping(method = RequestMethod.GET, value = "/code/getParent", consumes = "application/json")
	Result<Map<String, Object>> getParent( @RequestParam(value = "nodeHtml") String nodeHtml);

}
